#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main()
{
	int score[50];
	int n = 0;
	scanf("%d", &n);
	int i,j,temp;
	for (i = 0;i < n;i++)
	{
		scanf("%d", &score[i]);
	}
	for (i = 0;i < n;i++)
	{
		for (j = i;j <= n;j++)
		{
			if (score[i] < score[j])
			{
				temp = score[i];
				score[i] = score[j];
				score[j] = temp;
			}
		}
	}
	for (i = 0;i < 5;i++)
	{
		printf("%d ", score[i]);
	}

	return 0;
}
